

<?php

/**************************************************************************
* Source File	:  Connection.php
* Author        :  Amodeos - Herleman - Kuete
* Project name  :  Gestion Annuaire des anciens de l'UM2
* Modified   	:  19/05/2010
* Description	:  Definition de la classe Connection qui permet de se connecter a la BDD.
**************************************************************************/



class Connection 
{
	//Attributs
	private static $url = 'localhost';//'bebert.dyndns.tv';
	private static $dbname = 'collab';
	private static $login = 'root';
	private static $pass = 'pass';
	
	//Instance de la connection
	private static $connection;
	

	
	
	//Methodes
	public static function getInstance () {

		if (!isset(self::$connection)) {
				try {
					self::$connection = new PDO("mysql:host=". self::$url. ";dbname=" . self::$dbname, self::$login, self::$pass);
				}
				catch (Exception $e)
				{
					die('Erreur : ' . $e->getMessage());
				}
		}
		return self::$connection;
	}
	
	
		
	
}




?>
